using System.Collections.Generic;

namespace SmartMathLibrary.DataMining.ClusterAnalysis
{
    /// <summary>
    /// Interface to implement a Cluster class.
    /// </summary>
    public interface ICluster
    {
        /// <summary>
        /// Gets or sets the centroid of the cluster.
        /// </summary>
        /// <value>The centroid of the cluster.</value>
        GeneralVector Centroid { get; set; }

        /// <summary>
        /// Gets the members of the cluster.
        /// </summary>
        /// <value>The members of the cluster.</value>
        List<ClusterAnalysisItem> ClusterMembers { get; }

        /// <summary>
        /// Calculates the distance between the current position of the cluster and the specified item.
        /// </summary>
        /// <param name="item">The specified item.</param>
        /// <param name="distanceMeasureMode">The distance measure mode to use.</param>
        /// <returns>The distance between the current position of the cluster and the specified item.</returns>
        double CalculateDistance(ClusterAnalysisItem item, DistanceCalculationMode distanceMeasureMode);

        /// <summary>
        /// Calculates the new centroid of the cluster.
        /// </summary>
        void CalculateNewCentroid();

        /// <summary>
        /// Checks if the old and new position of the cluster is even.
        /// </summary>
        /// <param name="precision">The precision to use.</param>
        /// <returns>True if the positions are even otherwise, false.</returns>
        bool NewCentroidEqualsOldCentroid(double precision);
    }
}